package com.ruoyi.system.service.impl;


import com.ruoyi.system.domain.dto.MealVerifyDetailWrapperDTO;
import com.ruoyi.system.mapper.MealVerifyDetailMapper;
import com.ruoyi.system.service.IMealVerifyDetailService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
@RequiredArgsConstructor
public class MealVerifyDetailServiceImpl implements IMealVerifyDetailService {

    private final MealVerifyDetailMapper mapper;

    @Override
    public MealVerifyDetailWrapperDTO queryDetails(String trainingName,
                                            String dept,
                                            String mealType) {
        MealVerifyDetailWrapperDTO result = new MealVerifyDetailWrapperDTO();
        result.setDepartments(mapper.listDeptsByTrainingName(trainingName));
        result.setDetails(mapper.selectMealVerifyDetail(trainingName, dept, mealType));
        return result;
    }

    @Override
    public List<String> listDeptsByTrainingName(String trainingName) {
        return mapper.listDeptsByTrainingName(trainingName);
    }
}